let express = require('express');
let ImageAction = require('../../action/imageAction');
let router = express.Router();

router.post('/create', function (req, res) {
    if (req.files){
        res.res({imgUrl:req.files[0].imageUrl});
    }else{
        res.rej({errorInfo:"上传失败"});
    }
});

router.post('/getImage', function (req, res) {
    ImageAction.getImage(req.body).then(res.res,res.rej);
});
module.exports = router;